class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: C = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: C = None
        self.s: F = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.v: A = None
        self.txt = txt

j = A("j")
m = B("m")
h = C("h")
i = D("i")
f = E("f")
c = F("c")
g = B("g")

j.p = g
j.s = m
m.o = j
m.w = h
m.z = c
m.u = f
h.v = j
h.u = c
i.q = f
i.y = h
i.s = c
i.w = c
i.r = g
f.v = g
f.t = g
f.o = h
c.o = g
c.u = h
c.v = j
g.o = j
g.w = h
g.z = c
g.u = f
assert i.r.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: C = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: C = None
        self.s: F = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.v: A = None
        self.txt = txt

j = A("j")
m = B("m")
h = C("h")
i = D("i")
f = E("f")
c = F("c")
g = B("g")

j.p = g
j.s = m
m.o = j
m.w = h
m.z = c
m.u = f
h.v = j
h.u = c
i.q = f
i.y = h
i.s = c
i.w = c
i.r = g
f.v = g
f.t = g
f.o = h
c.o = g
c.u = h
c.v = j
g.o = j
g.w = h
g.z = c
g.u = f
assert i.r.o.p.txt == "g"