class A:
    def __init__(self, txt: str):
        self.q: F = 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: D = None
        self.r: E = None
        self.v: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

f.q = k
l.s = k
j.x = a
j.r = d
j.v = l
j.w = b
a.y = j
a.x = b
a.r = l
a.u = f
b.y = j
b.u = a
c.w = l
c.r = k
c.y = k
c.p = a
k.w = l
k.r = c
k.y = c
k.p = a
d.y = j
d.u = a
e.x = a
e.r = d
e.v = l
e.w = b
assert d.y.x.u.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = 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: D = None
        self.r: E = None
        self.v: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

f.q = k
l.s = k
j.x = a
j.r = d
j.v = l
j.w = b
a.y = j
a.x = b
a.r = l
a.u = f
b.y = j
b.u = a
c.w = l
c.r = k
c.y = k
c.p = a
k.w = l
k.r = c
k.y = c
k.p = a
d.y = j
d.u = a
e.x = a
e.r = d
e.v = l
e.w = b
assert d.y.x.u.q.y.txt == "c"