class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: A = None
        self.x: F = None
        self.w: C = None
        self.z: E = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.u: A = None
        self.txt = txt

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

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

b.q = d
b.x = d
b.s = h
b.w = c
b.z = f
b.t = f
a.s = d
c.x = a
c.v = a
c.t = h
c.p = f
c.u = d
e.z = c
e.w = c
e.s = c
e.u = a
e.o = d
e.r = f
f.w = c
f.q = c
f.u = b
d.q = a
h.q = d
h.x = d
h.s = b
h.w = c
h.z = f
h.t = f
assert f.u.t.w.u.txt == "d"