class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.z: B = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: E = None
        self.x: D = None
        self.s: F = None
        self.z: E = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: D = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

g = A("g")
j = B("j")
k = C("k")
e = D("e")
c = E("c")
l = F("l")
n = E("n")
f = F("f")

g.t = n
g.p = k
g.z = j
g.r = l
j.y = g
j.u = e
j.v = e
j.o = e
j.x = f
k.p = e
k.x = e
k.r = c
k.s = f
k.t = f
k.z = n
e.r = f
c.q = g
c.s = e
c.r = k
l.q = c
n.q = g
n.s = e
n.r = k
f.q = c
assert j.u.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.z: B = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: E = None
        self.x: D = None
        self.s: F = None
        self.z: E = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: D = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

g = A("g")
j = B("j")
k = C("k")
e = D("e")
c = E("c")
l = F("l")
n = E("n")
f = F("f")

g.t = n
g.p = k
g.z = j
g.r = l
j.y = g
j.u = e
j.v = e
j.o = e
j.x = f
k.p = e
k.x = e
k.r = c
k.s = f
k.t = f
k.z = n
e.r = f
c.q = g
c.s = e
c.r = k
l.q = c
n.q = g
n.s = e
n.r = k
f.q = c
assert j.u.r.q.txt == "c"