class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.p: G = None
        self.x: F = None
        self.s: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.v: G = None
        self.u: A = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

b = A("b")
d = B("d")
j = C("j")
g = D("g")
l = E("l")
f = F("f")
a = G("a")

b.w = d
b.q = l
b.p = a
b.s = a
b.x = f
d.p = g
j.s = d
g.r = l
g.s = l
g.v = a
g.y = a
g.u = b
l.s = f
l.p = f
l.v = b
f.t = a
a.t = b
assert d.p.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.p: G = None
        self.x: F = None
        self.s: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.v: G = None
        self.u: A = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

b = A("b")
d = B("d")
j = C("j")
g = D("g")
l = E("l")
f = F("f")
a = G("a")

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