class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: F = None
        self.p: A = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: C = None
        self.txt = txt

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

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

g = A("g")
h = B("h")
f = C("f")
d = D("d")
e = E("e")
l = F("l")
b = A("b")
c = D("c")

g.w = f
g.y = l
g.p = b
g.t = h
h.y = c
h.u = f
f.x = d
f.q = e
d.o = c
d.u = f
e.r = f
l.v = h
l.u = e
l.w = e
l.o = g
b.w = f
b.y = l
b.p = g
b.t = h
c.o = d
c.u = f
assert c.o.o.u.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: F = None
        self.p: A = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: C = None
        self.txt = txt

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

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

g = A("g")
h = B("h")
f = C("f")
d = D("d")
e = E("e")
l = F("l")
b = A("b")
c = D("c")

g.w = f
g.y = l
g.p = b
g.t = h
h.y = c
h.u = f
f.x = d
f.q = e
d.o = c
d.u = f
e.r = f
l.v = h
l.u = e
l.w = e
l.o = g
b.w = f
b.y = l
b.p = g
b.t = h
c.o = d
c.u = f
assert c.o.o.u.q.r.txt == "f"